# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
pkgname=libwpebackend-fdo
pkgver=1.6.1
pkgrel=0
pkgdesc="freedesktop.org backend for WPE WebKit"
url="https://wpewebkit.org/"
arch="all"
license="BSD-2-Clause"
makedepends="cmake mesa-dev glib-dev wayland-dev libwpe-dev"
options="!check" # no tests
subpackages="$pkgname-dev $pkgname-dbg"
source="https://github.com/Igalia/WPEBackend-fdo/releases/download/$pkgver/wpebackend-fdo-$pkgver.tar.xz"
builddir="$srcdir/wpebackend-fdo-$pkgver"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
		-DCMAKE_C_FLAGS="$CFLAGS" \
		$CMAKE_CROSSOPTS .
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="6b92063b719644277d1f29dd2adf8088de46b466c2286a523fce34b2961e944d11d001aa5cb0e481e42a17b9659271d58db3d94e26148f0b65321cc23f0384ea  wpebackend-fdo-1.6.1.tar.xz"
